#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;

// 快速幂计算 (base^exp) % mod
int fast_pow(int base, int exp)
{
    int result = 1;
    while (exp > 0)
    {
        if (exp % 2 == 1)
        {
            result = (1LL * result * base) % mod; // 避免溢出
        }
        base = (1LL * base * base) % mod;
        exp /= 2;
    }
    return result;
}

int main()
{
    int n, x, ans = 1;
    cin >> n;
    map<int, int> mp;

    for (int i = 1; i <= n; i++)
    {
        cin >> x;
        for (int j = 2; (long long)j * j <= x; j++)
        { // 避免 j*j 溢出
            if (x % j == 0)
            {
                int cnt = 0;
                while (x % j == 0)
                {
                    x /= j;
                    cnt++;
                }
                mp[j] = max(mp[j], cnt);
            }
        }
        if (x > 1)
        {
            mp[x] = max(mp[x], 1);
        }
    }

    for (auto &p : mp)
    {
        ans = (1LL * ans * fast_pow(p.first, p.second)) % mod;
    }

    cout << ans << endl;
    return 0;
}